package com.maxchaintech.integral.service.impl;

import java.util.List;

import com.maxchaintech.common.datasource.annotation.Slave;
import com.maxchaintech.integral.domain.IntegralDetail;
import com.maxchaintech.integral.mapper.IntegralDetailMapper;
import com.maxchaintech.integral.mapper.OracleMapper;
import com.maxchaintech.integral.service.IIntegralDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 积分记录明细Service业务层处理
 * 
 * @author jyw
 * @date 2021-04-23
 */
@Service
public class IntegralDetailServiceImpl implements IIntegralDetailService
{
    @Autowired
    private IntegralDetailMapper integralDetailMapper;

    @Autowired
    private OracleMapper oracleMapper;

    /**
     * 查询积分记录明细
     * 
     * @param id 积分记录明细ID
     * @return 积分记录明细
     */
    @Override
    public IntegralDetail selectIntegralDetailById(Long id)
    {
        return integralDetailMapper.selectIntegralDetailById(id);
    }

    /**
     * 查询积分记录明细列表
     * 
     * @param integralDetail 积分记录明细
     * @return 积分记录明细
     */
    @Override
    public List<IntegralDetail> selectIntegralDetailList(IntegralDetail integralDetail)
    {
        return integralDetailMapper.selectIntegralDetailList(integralDetail);
    }

    /**
     * 新增积分记录明细
     * 
     * @param integralDetail 积分记录明细
     * @return 结果
     */
    @Override
    public int insertIntegralDetail(IntegralDetail integralDetail)
    {
        return integralDetailMapper.insertIntegralDetail(integralDetail);
    }

    /**
     * 修改积分记录明细
     * 
     * @param integralDetail 积分记录明细
     * @return 结果
     */
    @Override
    public int updateIntegralDetail(IntegralDetail integralDetail)
    {
        return integralDetailMapper.updateIntegralDetail(integralDetail);
    }

    /**
     * 批量删除积分记录明细
     * 
     * @param ids 需要删除的积分记录明细ID
     * @return 结果
     */
    @Override
    public int deleteIntegralDetailByIds(Long[] ids)
    {
        return integralDetailMapper.deleteIntegralDetailByIds(ids);
    }

    /**
     * 删除积分记录明细信息
     * 
     * @param id 积分记录明细ID
     * @return 结果
     */
    @Override
    public int deleteIntegralDetailById(Long id)
    {
        return integralDetailMapper.deleteIntegralDetailById(id);
    }

    @Override
    @Slave
    public void selectddById(){
        List<String> strings = oracleMapper.selectById();
        strings.forEach(s-> System.out.println("测试："+s));
    }
}
